package user_router

import (
	user_controller "group-middleware/controller/user"
	user_middleware "group-middleware/middleware/user"

	"github.com/gin-gonic/gin"
)

func UserRouterInit(r *gin.Engine) {
	// 路由中间件方式1：
	apiUserRouter := r.Group("api/user", user_middleware.UserMiddleware{}.UserMidd1, user_middleware.UserMidd2)
	// 路由中间件方式2：
	// apiUserRouter := r.Group("api/user")
	// apiUserRouter.Use(user_controller.UserController{}.GetUser, user_controller.AddUser)
	{
		apiUserRouter.GET("list", user_controller.UserController{}.GetUser)
		apiUserRouter.GET("add", user_controller.AddUser)
	}
}
